<table id="dg-ybcx" style="height:100%;width: 100%;">
    <thead>
    <tr>
        <th data-options="field:'GS_MC',width:150">公司名称</th>
        <th data-options="field:'USER_XM',width:100">负责人</th>
        <th data-options="field:'DYZZ',width:150">在职人数</th>
        <th data-options="field:'DYXZ',width:150">新增人数</th>
        <th data-options="field:'DYJY',width:150">减员人数</th>
    </tr>
    </thead>
</table>

<div id="tb-ybcx">
    <table cellpadding="0" cellspacing="0" style="width:100%">
        <tr class="clearfix">
            <td class="luck-tool-button">
                月份: <input class="easyui-my97" name="dg_ybcx_cxyf" id="dg_ybcx_cxyf" data-options="dateFmt:'yyyyMM'" value="${dqrq,'YYYYMM'}">
                公司名称: <input class="easyui-textbox" name="dg_ybcx_gsmc" id="dg_ybcx_gsmc">
                负责人: <input class="easyui-textbox" name="dg_ybcx_xm" id="dg_ybcx_xm">
                <a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="ybcx_tool.search();">${i18n('btn.search')}</a>
                <a href="#" class="easyui-linkbutton button-teal" plain="true" onclick="ybcx_tool.export();"><i class="fa fa-file-excel-o fa-lg"></i>&nbsp;${i18n('btn.export')}</a>
            </td>
        </tr>
    </table>
</div>
<script>
    var dg_ybcx;
    $(function () {
        dg_ybcx = rsdp.createDataGrid({
            tid: "dg-ybcx",
            url: "${ctxPath}/htxx/ybcx/manage",
            idField: "",
            loadMsg: "${i18n('oper.loading')}",
            tbid: "tb-ybcx"
        });
    });

    var ybcx_tool = {
        refresh: function () {
            rsdp.refresh();
        },
        search: function () {
            dg_ybcx.datagrid('load', {
                cxyf: $('#dg_ybcx_cxyf').my97('getValue'),
                gsmc: $('#dg_ybcx_gsmc').val(),
                xm: $('#dg_ybcx_xm').val()
            });
        },
        export: function (obj) {
            var form = $("<form>");
            form.attr('style', 'display:none');
            form.attr('target', '');
            form.attr('method', 'post');
            form.attr('action', "${ctxPath}/htxx/ybcx/export");
            var input1 = $('<input>');
            input1.attr('type', 'hidden');
            input1.attr('name', 'cxyf');
            input1.attr('value', $('#dg_ybcx_cxyf').my97('getValue'));
            var input2 = $('<input>');
            input2.attr('type', 'hidden');
            input2.attr('name', 'xm');
            input2.attr('value', $('#dg_ybcx_xm').val());
            var input3 = $('<input>');
            input3.attr('type', 'hidden');
            input3.attr('name', 'gsmc');
            input3.attr('value', $('#dg_ybcx_gsmc').val());
            $('body').append(form);
            form.append(input1);
            form.append(input2);
            form.append(input3);
            form.submit();
            form.remove();
        }
    }
</script>